@extends('layouts.app')
@section('header')
     @include('common.header')
@stop
@section('title', config('index_title').'-个人中心')
@section('footer')
     @include('common.footer')
@stop
@section('content')

    <link href="/front/Content/assets/css/codemirror.css" rel="stylesheet" />
    <link href="/front/Content/assets/css/ace.min.css" rel="stylesheet" />
        <link href="/front/Content/zhanghuchongzhi.css" rel="stylesheet" />
         <style type="text/css">
            .profit_right p{
                font-size: 14px;
            }
            </style>
<div class="banner1"></div>
<div class="xtxx">
    <div class="xtxx_top">
        <div class="xtxx_tit"><p><a href="/home">个人中心</a>&nbsp;&gt;&nbsp;<a href="javascript:;">账户充值</a></p></div>
    </div>
    <div class="wdda wdda_profit">
                <div class="wdda_left fl">
                    <ul class="wdda-left ">
                        <li><a class="on" href="/user/recharge">账户充值</a></li>
                        <li><a href="/user/income">名片收益</a></li>
                        <li><a class="tixian" href="/user/withdraw">申请提现</a></li>
                        <li><a href="/user/withdrawRecord">提现记录</a></li>
                    </ul>
                </div>
                <div class="profit_right mt60 mb210">
                <form class="form-horizontal" id="ll" method="POST" action="/user/reCharge">
            {{ csrf_field() }}
                    <p><em>当前账户余额</em> <i>{{ Auth::user()->money }}</i> 元</p>
                    <p class="cz"><em>输入充值金额</em> <input type="number" value="{{session('money')?session('money'):old('money')}}" id="money" name="money"> 元  ( ≥ 20元)
                        </p>
                    <p class="mb79" style="    margin-bottom: 19px;">特别说明：一旦充值成功，仅可用于查看买家名片和文档下载，不可退款</p>
                    <p><span></span>点击“马上充值”，则代表您同意 <strong onclick="agree()">《名片宝用户协议》</strong></p>
					<p><strong>备注：充值成功后后请刷新本页面</strong></p>
                    <p style="height: auto">

                    
                        <style type="text/css">
                            
                            .pay-type{
                                width: 120px;
                                border: 3px solid #fff;
                                cursor: pointer;
                            }

                            .check-pay-type{
                            
                                border: 3px solid #FF5C69; 
                            }
                        </style>

                        <img class="pay-type check-pay-type" id="wx-pay-type" onclick="changePayType('wx')" src="/front/Content/images/wxpay.jpg">
                        <img class="pay-type" id="ali-pay-type" onclick="changePayType('ali')" src="/front/Content/images/alipay.jpg">

                          </p>

                       <div style="display: none;">
                            <input id="wx-pay-radio" name="type" style="width: auto; margin-right: 5px;   height: 19px;" type="radio" value="1" checked />微信
                        <input id="ali-pay-radio"  name="type" style="width: auto;margin-right: 5px; margin-left: 20px;    height: 19px;" type="radio" value="2" />支付宝
                       </div>

                 
                    
                    <div class="apply" style=" margin-left: 40px;"><a href="javascript:;" onclick="chong()">{{session('wechaturl')?'"码"上充值':'"码"上充值'}}</a></div>
					<div style="margin-left: 20px">
         @if(session('wechaturl'))
                        {!! QrCode::size(200)->generate(session('wechaturl')); !!}
                    @endif

                    </div>
                </form>
                </div>
            </div>
</div>
 <script type="text/javascript">
                            function changePayType(type){
                                $('.pay-type').removeClass('check-pay-type');

                                $('#'+type+'-pay-type').addClass('check-pay-type');
                                if(type == 'wx'){

                                     $('#wx-pay-radio').prop('checked', true);

                                }else{
                                    $('#ali-pay-radio').prop('checked', true);
                                }
                                
                              
                            }
                        </script>
<script type="text/javascript">

function chong()
{
/*	var money = $('#money').val();

	if(money < 50)
		{
layer.msg('金额必须大于50.');
return false;
		}*/
	$('#ll').submit();
}
function agree() {
	@php
	$content = \DB::table('categories')->where('id', 44)->value('content');
	@endphp
	layer.open({
		title: '《纺织品名片宝用户协议》',
		type: 1,
		  skin: 'layui-layer-rim', //加上边框
		  area: ['620px', '440px'], //宽高
		  content: '{!! $content  !!}'
		});
}


$(function(){
	@if(session('status') == 1)
		layer.msg('充值成功，请稍后刷新余额.');
	@endif
})
</script>
@endsection
